public class LQB_code1_2 {
    public static void main(String[] args) {
        long count=0;
        for (int i=1;i<=2019;i++){
            //将数字转为字符串
            String j = i + "";
            //将字符串转成字符数组 toCharArray()
            char[] ch = j.toCharArray();
            for (int k=0;k<ch.length;k++){
                if(ch[k]=='2'||ch[k]=='0'||ch[k]=='1'||ch[k]=='9'){
                    count+=i;
                    break;
                }
            }
        }
        System.out.println(count);
    }
}
